<template>
	<view class="page">
		<view>
			<view class="title">
				瀚联实名考勤打卡系统
			</view>
			<view class="input">
				<uni-easyinput v-model="form.phone" :styles="styles" :placeholderStyle="placeholderStyle"
					placeholder="手机/邮箱/用户名" />

				<view class="warn-text">未识别到您的信息，请联系管理员！</view>
			</view>
			<view class="button">
				<button type="default" @click="enterSignUpMap">下一步</button>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				/// 输入框样式
				value: '',
				password: '',
				placeholderStyle: "color:#169BD5;font-size:14px",
				styles: {
					color: '#169BD5',
					borderColor: '#169BD5',
				},
				form: {
					phone: "",
					password: "",
				},
				userInfo:{
					userId:37
				}
			}
		},
		methods: {
			enterSignUpMap() {

				if(this.form.phone == ''){
					uni.showModal({
						title: "未输入手机/邮箱/用户名",
						showCancel: false,
						confirmText: "确定"
					})
				}else{
					uni.request({
						url: 'http://116.205.142.103:8808/labor/system/user/getUser?condition='+this.form.phone,
						method: 'get',
						success: (res) => {
							if(res.data.data != null){
								this.userInfo = res.data.data
								uni.navigateTo({
									url: "/pages/signUp/signUpMap/signUpMap?userInfo="+ JSON.stringify(this.userInfo)
								})
							}else{
								uni.showModal({
									title: "用户不存在，请联系管理员",
									showCancel: false,
									confirmText: "确定"
								})
							}
						}
					})
				}
				console.log("下一步")
				//localhost:8808/labor/system/user/getUser?condition=360402198611133850
				
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		padding: 20rpx;

		.input {
			width: 600rpx;
			margin: 100rpx auto 0;

			.warn-text {
				color: #ff0000;
				margin-top: 20rpx;
			}
		}

		.title {
			font-size: 50rpx;
			text-align: center;
			height: 120rpx;
			line-height: 120rpx;
		}

		.button {
			width: 600rpx;
			margin: 120rpx auto 0;
			border-radius: 10rpx;
		}
	}

	uni-button[type=default] {
		background-color: #13BC75 !important;
		color: white;
	}
</style>
